/**
 * 数据分组
 * @param {Array} oArr - 原数组列表
 * @param {Number} length - 单个数组长度
 * @return {Array}  arr - 分组后的新数组
 */
function splitData(oArr: Array<any> = [], length = 1) {
    const arr: Array<any> = [];
    let minArr: Array<any> = [];
    oArr.forEach(c => {
        if (minArr.length === length) {
            minArr = [];
        }
        if (minArr.length === 0) {
            arr.push(minArr);
        }
        minArr.push(c);
    });

    return arr;
}

export default {
    splitData,
};
